//
//  CQTitleResultTableViewCell.m
//  TSListDemo
//
//  Created by qian on 2020/11/18.
//  Copyright © 2020 dvlproad. All rights reserved.
//

#import "CQTitleResultTableViewCell.h"
#import <Masonry/Masonry.h>
#import <CJBaseUIKit/UIColor+CJHex.h>

@implementation CQTitleResultTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier];
    if (self) {
        self.cq_accessoryType = CQTableViewCellAccessoryNone;
    }
    return self;
}

#pragma mark - Setter
- (void)setTitle:(NSString *)title {
    _title = title;
    self.textLabel.text = title;
}

- (void)setResult:(NSString *)result {
    _result = result;
    self.detailTextLabel.text = result;
}

- (void)setHideIndicator:(BOOL)hideIndicator {
    _hideIndicator = hideIndicator;
    
    if (hideIndicator) {
        self.accessoryType = UITableViewCellAccessoryNone;
    } else {
        self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
}

#pragma mark - Event
- (void)updateThemeType:(BOOL)isBlack {
    if (isBlack) {
        self.backgroundColor = CJColorFromHexString(@"#26262C");
        self.textLabel.textColor = CJColorFromHexString(@"#6D6F76");
        self.detailTextLabel.textColor = CJColorFromHexString(@"#FFFFFF");
    } else {
        self.backgroundColor = CJColorFromHexString(@"#FFFFFF");
        self.textLabel.textColor = CJColorFromHexString(@"#B6B7BA");
        self.detailTextLabel.textColor = CJColorFromHexString(@"#0C101B");
    }
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
